<!--
	This page shows the register form after you click the register on the home page
-->
<?php include 'config.php'?>
<?php
	$conn = mysql_connect($host, $user, $password) or die(mysql_error());
	mysql_select_db("travel");
	
	$sql = "SELECT * FROM mailers";
	$result = mysql_query($sql, $conn) or die(mysql_error());
?>

<?php include 'header.php'?>

<?php
if (isset($_POST['submit'])) {
echo <<< HERE
	<script type="text/javascript">
		window.alert("You message goes here!");
	</script>
HERE;
	//header('location: home.php');
}
?>

<div>
    <div id="Content">
		
		<header class="row">
			<h2>Contact Us</h2>
		</header>
		
		<form class="row" action="" method="post">
			<table cellpadding="100px">
				<tr>
					<td><b>Your Name:&nbsp;&nbsp;&nbsp;&nbsp;</b></td>
					<td><input type="text" name="name"/></td>
				</tr>
				<tr>	
					<td>&nbsp;</td>
				</tr>
				<tr>
					<td><b>Your Email:</b></td>
					<td>
						<input type="text" name="username"/>@<select name="mailbox">
						<?php
							while ($row = mysql_fetch_assoc($result)) {
								foreach ($row as $mail => $mailer) {
									echo "<option>$mailer</option>";
								}
							}
						?>
						</select>
					</td>
				</tr>
				<tr>	
					<td>&nbsp;</td>
				</tr>
				<tr>
					<td><b>Subject: </b></td>
					<td><input type="text" name="subject" /></td>
				</tr>
			</table>
			<br/>
			<p><b>Comments:</b></p>
			<textarea rows="10" cols="40"></textarea>
			<br/>
			<!--<input type="submit" class="button-primary" />-->
			<a class="button-primary" href="javascript:alert('Your message has been sent.');location.href='home.php';">Submit</a>

		</form>
		
	</div>

<?php include 'footer.php'?>